home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT12 / CCURS.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-05-10  |  1.5 KB  |  50 lines

  1.  
  2.  ;************************************************************
  3.  ;  Program CCurs ( Chapter 12 )
  4.  ;
  5.  ;  The PC screen input/output library    Version 1.0
  6.  ;  Subroutine for moving the cursor to a specified position
  7.  ;  Copyright (c): A.I.Sopin, Voronezh, Russia 1990 - 1991
  8.  ;
  9.  ;  This subroutine can be called from programs written in C/C++
  10.  ;
  11.  ;  C description: void CCURS (int U, int V)
  12.  ;
  13.  ;  Parameters:
  14.  ;
  15.  ;  U   - Y coordinate of the cursor (row): 1 -- 50
  16.  ;  V   - X coordinate of the cursor (colomn): 1 -- 80
  17.  ;
  18.  ;  All parameters are  through the stack
  19.  ;
  20.  ;***********************************************************
  21.     .MODEL  SMALL
  22.     .CODE
  23.     PUBLIC  _CCURS
  24. _CCURS  PROC    NEAR
  25.     push    bp
  26.     mov     bp,sp
  27.     push    ax
  28.     push    bx
  29.     push    cx
  30.     push    dx
  31. ;----------------------------------------------------------
  32. ;  Moving the cursor to the position specified
  33.     mov     dh,[bp+4]               ;  accept parameter U
  34.     dec     dh                      ;  convert to BIOS standard (from 0)
  35.     mov     dl,[bp+6]               ;  accept parameter U
  36.     dec     dl                      ;  convert to BIOS standard (from 0)
  37.     xor     bh,bh                   ;  video page 0 is used
  38.     mov     ah,2                    ;  function 02h - set cursor
  39.     int     10h                     ;  BIOS video service call
  40. ;----------------------------------------------------------
  41. ;  Restore registers and return to caller
  42.     pop     dx
  43.     pop     cx
  44.     pop     bx
  45.     pop     ax
  46.     pop     bp
  47.     RETN
  48. _CCURS  ENDP
  49.     END
  50.